<template>
	<div>
		<view class="menu_box">
			
			<view class="menu">
				<view class="con">
					<view class="num">{{z}}</view>
					<view class="text">团队总人数</view>
				</view>
			</view>
			<view class="menu">
				<view class="con">
					<view class="num">{{q}}</view>
					<view class="text">直推人数</view>
				</view>
			</view>
			<view class="menu">
				<view class="con">
					<view class="num">{{y}}</view>
					<view class="text">间推人数</view>
				</view>
			</view>
			
			<!-- <view class="menu menu2">
				<view class="con">
					<view class="num">{{yj}}</view>
					<view class="text">我的业绩</view>
				</view>
			</view>
			<view class="menu menu2 menu2_border">
				<view class="con">
					<view class="num">{{all_yj}}</view>
					<view class="text">团队业绩</view>
				</view>
			</view> -->
			
		</view>
		
		<view class="head">
			<input class="h_input" type="text" v-model="kw" placeholder="输入名字(完整)">
			<view class="iconfont h_icon" @click="getData">&#xe605;</view>
		</view>
		
		<scroll-view class="listItem" scroll-y>
			<view class="list_main">
				<view class="list" v-for="(item,index) in list" :key="index">
					<view class="l_con">
						<view class="l_left">
							<view class="l_l_name"><block v-if='item.bank_name'>{{item.bank_name}}</block><block v-else>{{item.name}}</block><view class="level">{{item.lv_id}}</view></view>
							<view class="l_l_tel">业绩：{{item.yj}}</view>
						</view>
						<view class="l_right">
							<view class="tip">分享<br>人数</view>
					{{item.td}}
						</view>
					</view>
				<!-- 	<view class="total">
						<view class="t_txt">个人业绩：{{item.yj}}</view>
						<view class="t_txt">团队业绩：{{item.all_yj}}</view>
					</view> -->
			<!-- 		<view class="tools" v-if='tz'>
						<view class="t_btn"v-if="item.status" @click="dj(item.id,0,'status',index)">冻结账号</view>
						<view class="t_btn"v-else @click="dj(item.id,1,'status',index)">解冻账号</view>
						<view class="t_btn"v-if="!item.ss" @click="dj(item.id,1,'ss',index)">升级服务中心</view>
						<view class="t_btn"v-else @click="dj(item.id,0,'ss',index)">解除服务中心</view>
					</view> -->
				</view>
			</view>
		</scroll-view>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				z:0,
				q:0,
				y:0,
				yj:0,
				all_yj:0,
				kw:'',
				list:[],
                tz:0,
				history:[],
				
			};
		},
		onLoad() {
		
			this.getData();
		},
		methods:{ 
			
			getData(type='clear'){
					let me = this;
			me.Net._get('td', {kw:me.kw}, res => {
				if (res.code == 1) {
					me.list=res.data.list
					me.z = res.data.z;
					me.yj = res.data.yj;
					me.all_yj = res.data.all_yj;
					me.y = res.data.y;
					me.q = res.data.q;
					me.tz = res.data.tz;
				}
			});
			},
			
			dj(id,e,key,index){
					let me = this;
			me.Net._get('dj', {id:id,st:e,key:key}, res => {
				if (res.code == 1) {
					me.Msg.Success('操作成功', res => {
						let _arr = JSON.parse(JSON.stringify(me.list));
						_arr[index][key]=e;
						me.list = _arr;
						 //  me.getData()
					});
				 
				}
			});
			},
			// 返回上一页
			backPage(){
				uni.navigateBack({
					delta: 1
				})
			},
		}
	}
</script>

<style lang="scss">
.menu_box {
	width: 100%;
	padding: 2vh 4% 2vh;
	background-color: #4d726f;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	.menu {
		width: 33%;
		position: relative;
		.con {
			width: 100%;
			height: 100%;
			.num {
				font-size: 32rpx;
				color: #fff;
				font-weight: bold;
				text-align: center;
			}
			.text {
				font-size: 28rpx;
				color: #fff;
				margin-top: 15rpx;
				text-align: center;
			}
		}
		.menu_tip{
			width: 100%;
			padding-top: 20rpx;
			color: #ffffff;
			font-size: 28rpx;
			text-align: center;
			.m_tip::after{
				content: '';
				position: absolute;
				bottom: -6rpx;
				left: 7%;
				width: 86%;
				height: 1rpx;
				background: #FFFFFF;
			}
			.m_tip{
				position: relative;
				.mt_icon{
					font-size: 35rpx;
					margin-right: 15rpx;
				}
			}
		}
	}
	.menu2{
		width: 50%;
		margin-top: 2vh;
	}
	.menu2_border{
		border-left: 1rpx solid #ffffff;
	}
}

.head{
	width: 100%;
	height: 7vh;
	display: flex;
	align-items: center;
	box-sizing: border-box;
	padding: 0 4%;
	background: #ffffff;
	.h_input{
		height: 5vh;
		flex: 1;
		box-shadow: 0 0 5rpx 5rpx #f4f2f3;
		border-radius: 15rpx;
		line-height: 5vh;
		font-size: 30rpx;
		padding: 0 30rpx;
		margin-right: 30rpx;
	}
	.h_icon{
		padding: 0 30rpx;
		background: #fc493a;
		font-size: 45rpx;
		height: 4.5vh;
		line-height: 4.5vh;
		border-radius: 15rpx;
		color: #ffffff;
	}
}
.listItem{
    background: #f7f7f7;
	/* #ifdef H5 */
		height: calc(86vh - 44px - 175rpx);
	/* #endif */
	/* #ifndef H5 */
		height: calc(87vh - 175rpx);
	/* #endif */
    position: relative;
	overflow: hidden;
	z-index: 10;
	padding: 10rpx 4% 30rpx;
    .list_main{
		width: 100%;
		.list{
			width: 100%;
			background: #FFFFFF;
			margin-top: 20rpx;
			padding: 25rpx;
			border-radius: 20rpx;
			display: inline-block;
			.l_con{
				display: flex;
				align-items: center;
				padding-bottom: 15rpx;
				.l_left{
					flex: 1;
					.l_l_name{
						width: 100%;
						font-size: 32rpx;
						font-weight: bold;
						color: #333333;
						display: flex;
						align-items: center;
						.level{
							padding: 5rpx 15rpx;
							border-radius: 15rpx;
							background: #4d726f;
							color: #ffffff;
							font-size: 22rpx;
							margin-left: 15rpx;
						}
					}
					.l_l_tel{
						font-size: 26rpx;
						color: #8a8a8a;
						padding-top: 15rpx;
						display: flex;
						align-items: center;
						.icon{
							font-size: 35rpx;
							color: #d1d1d1;
							margin-top: -10rpx;
						}
					}
				}
				.l_right{
					width: 20%;
					font-size: 35rpx;
					font-weight: bold;
					color: #fc493a;
					position: relative;
					.tip{
						position: absolute;
						top: -30rpx;
						right: 0;
						font-size: 22rpx;
						font-weight: 500;
					}
				}
			}
			.total{
				width: 100%;
				display: flex;
				align-items: center;
				padding: 10rpx 0;
				.t_txt{
					flex: 1;
					font-size: 26rpx;
					color: #4d726f;
					text-align: left;
				}
			}
			.tools{
				padding: 20rpx 0 0;
				margin-top: 10rpx;
				border-top: 1rpx solid #f4f4f4;
				display: flex;
				align-items: center;
				justify-content: flex-end;
				.t_btn:not(:first-of-type){
					margin-left: 20rpx;
				}
				.t_btn{
					padding: 6rpx 25rpx;
					border-radius: 50rpx;
					font-size: 26rpx;
					color: #333333;
					border: 1rpx solid #333333;
				}
			}
		}
	}
}
</style>
